/**
 * Created by wenchaang on 2017/4/5.
 */
const theformatDate={
    getOffsetDate(offset,spe,date){
      var timer,curMon,curDay,ret='';
      if(date){
        timer=new Date(date.slice(0,4), date.slice(4,6), date.slice(6,8));
        timer.setMonth(timer.getMonth()-1)
      }else{
        timer=new Date();
      }
      if(offset){
        timer.setDate(timer.getDate()+offset);
      }
      curMon=timer.getMonth()+1;
      curDay=timer.getDate();
      if(curMon<10){
        curMon='0'+curMon;
      }
      if(curDay<10){
        curDay='0'+curDay;
      }
      if(spe){
        ret=timer.getFullYear()+spe+curMon+spe+curDay;
      }else{
        ret=timer.getFullYear()+''+curMon+''+curDay;
      }
      return ret;

    }
}
export default theformatDate;

